import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit";
import AuthReducer from "./Auth";
import RouterReducer from './Router';
import AnalyzeReducer from './Analyze';
import ProfileReducer from './Profile';

export const store = configureStore({
  reducer: {
    authReducer: AuthReducer,
    routerReducer: RouterReducer,
    analyzeReducer: AnalyzeReducer,
    profileReducer: ProfileReducer
  }
});

export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
  ReturnType,
  RootState,
  unknown,
  Action<string>
>;
